import request from '@/plugins/axios'

// 测试连接
export const testConnection = (data) => {
  return request({
    url: '/generate/testConnection',
    method: 'post',
    data: data
  })
}

// 获取表
export const getTables = (data) => {
  return request({
    url: '/generate/getTables',
    method: 'post',
    data: data
  })
}

// 生成代码
export const generateCode = (data) => {
  return request({
    url: '/generate/generateModels',
    method: 'post',
    data: data
  })
}

export const generateModelsAndDownLoad = (data) => {
  return request({
    url: '/generate/generateModelsAndDownLoad',
    method: 'post',
    data: data,
    responseType:'blob'
  })
}
